import request from '@/utils/request'

/**
 * 获取全部权限列表
 */
export function getList() {
  return request({
    url: '/permission/listMenu',
    method: 'get',
    data: {}
  })
}

/**
 * 添加权限
 * @param data
 */
export function add(data) {
  return request({
    url: '/permission/add',
    method: 'post',
    data: data
  })
}

/**
 * 更新权限
 * @param data
 */
export function update(data) {
  return request({
    url: '/permission/update',
    method: 'post',
    data: data
  })
}

/**
 * 删除权限，单个删除
 * @param id
 */
export function deleted(id) {
  return request({
    url: '/permission/delete',
    method: 'post',
    data: {
      id: id
    }
  })
}
